<!--
@Author: 赵明洋 3016214077

@Date: 2018-12-12

@员工外出状态查询界面

@Last Modified time: 2018-12-16-->
<div class="box">
  <div class="box-header">
    <h3 class="box-title">外出状态查询</h3>
    &nbsp;
    &nbsp;
    <a class ="btn btn-success btn-sm" (click) ="create()">
      <span class ="glyphicon glyphicon-plus"></span>添加新申请
    </a>

  <!-- /.box-header -->
  <div class="box-body table-responsive no-padding" >
    <table class="table table-hover">
      <tr>
        <th>申请编号</th>
        <th>申请员工编号</th>
        <th>外出开始时间</th>
        <th>外出结束时间</th>
        <th>外出天数</th>
        <th>当前状态</th>
        <th>操作</th>
      </tr>
      <tr *ngFor="let OutRequest of OutRequests ; let i = index;">
        <td>{{OutRequest.id}}</td>
        <td>{{OutRequest.user_id}}</td>
        <td>{{OutRequest.start_time}}</td>
        <td>{{OutRequest.end_time}}</td>
        <td>{{OutRequest.duration}}</td>

        <td>{{selectState(OutRequest.state)}}</td>
        <td *ngIf="OutRequest.user_id == sid">
            <a class="btn btn-danger btn-sm" style="background:rgb(92, 179, 233);border: rgb(92, 179, 233)" (click)="lookSuggestion(OutRequest.suggestion)">查看审批意见</a>
            &nbsp;&nbsp;
            <a class="btn btn-warning btn-xs"  *ngIf="OutRequest.state != 1" (click)="update(OutRequest)" style="margin-left: 25%">修改</a>
            &nbsp;
            <a class="btn btn-danger btn-xs" *ngIf="OutRequest.state != 1" (click)="delete(OutRequest)" style="margin-left: 2%">删除 </a>
          </td>
      </tr>
      
    </table>
  </div>
  <!-- /.box-body -->
</div>
<div id="popup" *ngIf="suggestion">
    <div class="bg">
      <div class="box box-primary" style="float:left;width: 55%;margin-left:25%;margin-top: 5%;text-align: center">
        <div class="box-body box-profile">
          <a class="btn btn-danger btn-xs" style="margin: 0 0 0 95%;" (click)="backSuggestion()">返回</a>
          <h3 class="profile-username text-center">审批意见</h3>

          <div style="white-space: pre-line;">
            <li class="list-group-item">
              <div>
                <textarea class="textarea" readonly="readonly" style="width: 100%; height: 500px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;">
                    {{suggestion}}
                </textarea>

              </div>
            </li>
          </div>


        </div>
      </div>
    </div>